package com.bkhc.order.repository;

import com.bkhc.order.entity.Order;
import com.bkhc.order.entity.OrderItem;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.List;

@Repository
public interface OrderItemRepository extends JpaRepository<OrderItem,String> , JpaSpecificationExecutor<OrderItem> {

     List<OrderItem> findByOrderCode(String orderCoder);
     @Query("select o from OrderItem o where o.orderCode in (:allOrderCode)")
    List<OrderItem> findByOrderCodeIn(@Param("allOrderCode") List<String> allOrderCode);
}
